package com.cosina.game.tank.ai.various;

import java.util.ArrayList;
import java.util.List;

import com.cosina.game.tank.ai.Command;
import com.cosina.game.tank.model.impl.EnemyTank;

public abstract class EnemyTankCommand implements Command{

	public static List<EnemyTankCommand> etcList = new ArrayList<EnemyTankCommand>();
	static {
		etcList.add(new DoNothing());
		etcList.add(new DoShot());
		etcList.add(new DoMoveDown());
		etcList.add(new DoMoveUp());
		etcList.add(new DoMoveLeft());
		etcList.add(new DoMoveRight());
	}
	
	@Override
	public void doBy(Object object) {
		doBy((EnemyTank)object);
	}

	public abstract void doBy(EnemyTank et);
}

class DoNothing extends EnemyTankCommand{
	@Override
	public void doBy(EnemyTank et) {
	}
}

class DoShot extends EnemyTankCommand{
	@Override
	public void doBy(EnemyTank et) {
		et.shot();
	}
}

class DoMoveDown extends EnemyTankCommand{
	@Override
	public void doBy(EnemyTank et) {
		et.moveDirectionAdapter.doDown();
	}
}

class DoMoveUp extends EnemyTankCommand{
	@Override
	public void doBy(EnemyTank et) {
		et.moveDirectionAdapter.doUp();
	}
}

class DoMoveLeft extends EnemyTankCommand{
	@Override
	public void doBy(EnemyTank et) {
		et.moveDirectionAdapter.doLeft();
	}
}

class DoMoveRight extends EnemyTankCommand{
	@Override
	public void doBy(EnemyTank et) {
		et.moveDirectionAdapter.doRight();
	}
}